package com.serv;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;


@WebServlet({ "/name" })

public class HelloServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;

    public HelloServlet() {
        super();
       
    }

	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
	
	}

	
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		String Fname = request.getParameter("Fname");
		String Lname = request.getParameter("Lname");
		String prof = request.getParameter("prof");

	
		
		response.setContentType("text/html");
		PrintWriter pw = response.getWriter();
		
		HttpSession session=request.getSession();
		
		
		pw.println(" <body> <center> <B> Helloooo Welcome :) </br> <b> ");
		pw.println(Fname + " " + Lname + " <p> you are a very good "+ prof);
		String[] loc = request.getParameterValues("location");
		pw.println("You are at "+ loc.length + "places");
		
		for(int i=0;i<loc.length;i++){
			pw.println(loc[i]);
		}
		pw.close();
		
	}

}
